package epsi.mobile.helpers;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

// For control the network acces
public final class NetworkHelper {
	
	// Verify if we have acces to the network
	public static boolean isOnline(Context c) 
	{
	    ConnectivityManager connMgr = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
	    NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
	    return (networkInfo != null && networkInfo.isConnected());
	}  
}
